package com.me.study.javaCore.event.java;

import com.me.common.util.event.EventPublishCenter;
import java.util.EventObject;

/**
 * 测试 Java事件
 *
 * @author ME
 * @date   2020/5/10
 */
public class TestJavaEvent {

    public static void main(String[] args) {
        Door door = new Door();
        EventObject event = new EventObject(door);
        EventPublishCenter.subscribe(event, new OpenDoorListener());

        door.open();
        EventPublishCenter.publish(event);
    }

}
